import React from 'react'
import routes from './routes'
import { Route } from 'react-router-dom'

/**
 * 基础路由
 */
function BaseRoutes() {
    return routes.map(({ path, ComponentName, exact = true, routes = [] }) => <Route path={path} key={path as string} exact={exact}
        // 这里是嵌套子路由
        render={props => <ComponentName {...props} routes={routes} />}></Route>)
}

export default BaseRoutes